#pragma once

class MainWindow;

class http_service;

class http_server {
public:
    http_server(http_service& service, const char * ip, int port,
                MainWindow *parent);
    ~http_server();

    void run();
    void stop();

    http_service& get_service() {
        return service_;
    }

private:
    http_service& service_;
    std::string ip_;
    int port_;
    MainWindow *parent_;
    acl::fiber_tbox<bool> *box_;

    void server_start();
};
